<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {:widget_st('layui','css')}
  {:widget_st('admin','css')}
  {:widget_st('jq','js')}
</head>
{:do_action('admin_head')}
<body>
  <style>
    @media screen and (min-width:1200px) {
      .list_item{
        width: 800px;
      }
    }
    .list_item>.layui-form-item:first-child{
      margin-bottom:0px;
    }
    .zf-layui-tips{
      border-bottom: 1px dashed #ccc;
    }
    .zf-tip-content-hidden{
      display: none;
    }
    .layui-input-block{
      min-height: 0px;
    }
  </style>
  <?php $form_widget = new \app\common\widget\FormPro();  ?>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">

        <div class="layui-card">
          <div class="layui-card-header layuiadmin-card-header-auto">
              <?php $menu_type = ['阿里云','七牛云','又拍云','雨云S3']; ?>
            <?php foreach($menu_type as $k=>$vo){ ?>
              <a class="layui-btn layui-btn-sm {$vo!=$type?'layui-btn-primary':''}" href='{:url("config/oss_config")}?type={$vo}'>{$vo}</a>
            <?php } ?>
          </div>
          <div class="layui-card-body" pad15>

            <form class="info_tj" >
              <div class="layui-form" wid100 lay-filter="">
                <?php if($type=='阿里云'){ ?>
                  <?php if(!is_dir('./vendor/aliyuncs/oss-sdk-php')){ ?>
                    <blockquote class="layui-elem-quote" style="text-align: center;">
                      使用此功能需先安装扩展 composer require aliyuncs/oss-sdk-php v2.4.1
                    </blockquote>
                  <?php } ?>

                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥Ak</a>','name'=>'ali_ak','data'=>isset_arr_key($config,'ali_ak',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.ali_ak") 秘钥Ak</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥SK</a>','name'=>'ali_sk','data'=>isset_arr_key($config,'ali_sk',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.ali_sk") 秘钥SK</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">空间名称</a>','name'=>'ali_bucket','data'=>isset_arr_key($config,'ali_bucket',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.ali_bucket") 空间名称</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">域名</a>','name'=>'ali_domain','data'=>isset_arr_key($config,'ali_domain',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.ali_domain") 域名  例如: oss-cn-shenzhen.aliyuncs.com </span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">自定义域名</a>','name'=>'ali_domain_diy','data'=>isset_arr_key($config,'ali_domain_diy',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.ali_domain_diy") 自定义域名<span style="color:red">需设置反向代理</span>如不使用请留空 例如: http://oss.aaaa.com</span></div>','theme'=>2])|raw}
                  </div>


                
                <?php }elseif($type=='七牛云'){ ?>
                  <?php if(!is_dir('./vendor/overtrue/flysystem-qiniu')){ ?>
                    <blockquote class="layui-elem-quote" style="text-align: center;">
                      使用此功能需先安装扩展 composer require overtrue/flysystem-qiniu v1.0.5
                    </blockquote>
                  <?php } ?>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥Ak</a>','name'=>'qny_ak','data'=>isset_arr_key($config,'qny_ak',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.qny_ak") 秘钥Ak</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥SK</a>','name'=>'qny_sk','data'=>isset_arr_key($config,'qny_sk',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.qny_sk") 秘钥SK</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">空间名称</a>','name'=>'qny_bucket','data'=>isset_arr_key($config,'qny_bucket',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.qny_bucket") 空间名称</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">域名</a>','name'=>'qny_domain','data'=>isset_arr_key($config,'qny_domain',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.qny_domain") 域名  例如: http://qknkajt4c.hn-bkt.clouddn.com </span></div>','theme'=>2])|raw}
                  </div>
                  

                  

                <?php }elseif($type=='又拍云'){ ?>
                  <?php if(!is_dir('./vendor/upyun/sdk')){ ?>
                    <blockquote class="layui-elem-quote" style="text-align: center;">
                      使用此功能需先安装扩展 composer require upyun/sdk
                    </blockquote>
                  <?php } ?>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">服务名</a>','name'=>'upy_name','data'=>isset_arr_key($config,'upy_name',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.upy_name") 服务名   </span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">操作员账号</a>','name'=>'upy_user','data'=>isset_arr_key($config,'upy_user',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.upy_user") 操作员账号   </span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">操作员密码</a>','name'=>'upy_pwd','data'=>isset_arr_key($config,'upy_pwd',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.upy_pwd") 操作员密码   </span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">域名</a>','name'=>'upy_domain','data'=>isset_arr_key($config,'upy_domain',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.upy_domain") 域名  例如: http://zf-test.b0.aicdn.com </span></div>','theme'=>2])|raw}
                  </div>
  
                  
                <?php }elseif($type=='雨云S3'){ ?>
                  <?php if(!is_dir('./vendor/league/flysystem-aws-s3-v3')){ ?>
                    <blockquote class="layui-elem-quote" style="text-align: center;">
                      使用此功能需先安装扩展 composer require league/flysystem-aws-s3-v3
                    </blockquote>
                  <?php } ?>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥Ak</a>','name'=>'rain_ak','data'=>isset_arr_key($config,'rain_ak',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.rain_ak") 秘钥Ak</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">秘钥SK</a>','name'=>'rain_sk','data'=>isset_arr_key($config,'rain_sk',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.rain_sk") 秘钥SK</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">空间名称</a>','name'=>'rain_bucket','data'=>isset_arr_key($config,'rain_bucket',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.rain_bucket") 空间名称</span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">API端点</a>','name'=>'rain_domain','data'=>isset_arr_key($config,'rain_domain',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.rain_domain") API端点  例如: https://cn-sy1.rains3.com/zfcms-test </span></div>','theme'=>2])|raw}
                  </div>
                  <div  class="list_item" >
                    {$form_widget->form_input(['title'=>'<a class="zf-layui-tips">自定义域名</a>','name'=>'rain_domain_diy','data'=>isset_arr_key($config,'rain_domain_diy',''),'theme'=>2])|raw}
                    {$form_widget->form_note(['data'=>'<div class="zf-tip-content-hidden"><span class="layui-badge_  layui-bg-cyan_ ">ZFC("oss_config.rain_domain_diy") 自定义域名<span style="color:red"></span>如不使用请留空 例如: http://oss.aaaa.com</span></div>','theme'=>2])|raw}
                  </div>
                  

                
                <?php } ?>
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <a href="javascript:;" class="layui-btn layui-btn-sm"  onclick="tijiao_data2('config/oss_config',0)" >确认保存</a>
                    <a class="layui-btn layui-btn-sm layui-btn-danger" href="https://bbs.zf-sys.com/bbs_detail/171.html" target="_blank" >查看帮助</a>
                  </div>
                </div>


                


              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

  {:widget_st('layui','js')}  
  {:widget_st('common','js')} 

  <script>
 layui.define(['form', 'upload'], function(exports){
  var $ = layui.$
  ,layer = layui.layer
  ,laytpl = layui.laytpl
  ,setter = layui.setter
  ,view = layui.view
  ,admin = layui.admin
  ,form = layui.form
  ,upload = layui.upload;

  $('.zf-layui-tips').on('click', function(){
    var othis = $(this).parent().parent().parent().find('div:eq(2)').find('.layui-input-block .zf-tip-content-hidden').html()
    layer.tips(othis, this, {
      tips: 1,
      time: 8000
    });
  });
 
    window.tijiao_data2 = function(role,type=1){
      var index = layer.load(2);
      var data = $(".info_tj input,.info_tj select,.info_tj textarea,.info_tj radio").serialize();      
          $.ajax({
            type:'post',
            url:'../'+role,
            data:data,
            dataType:'json',
            success:function(res){
              console.log(res)
              if(res.result==1){
                layer.msg(res.msg, {icon: 1});
                layer.close(index)
                setTimeout(function() {
                  if(type==1){
                  parent.location.reload();
                  }else{
                  // location.reload();
                  }
                }, 2000);
              }else{
                layer.msg(res.msg, {icon: 2});
                layer.close(index)
              }   
            }
          })
    }
   

 })
  </script>
</body>
</html>
{:do_action('admin_js')}